<?php
class ORMProduceItemMail extends ORMBase {
  public function __construct() {
    parent::__construct('ProduceItemMail');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->createdDate = (isset($object->createdDate) && $object->createdDate) ? SimpleDate::toStamp($object->createdDate) : 0;
    $epObject->sentDate = (isset($object->sentDate) && $object->sentDate) ? SimpleDate::toStamp($object->sentDate) : 0;
    $epObject->receivedDate = (isset($object->receivedDate) && $object->receivedDate) ? SimpleDate::toStamp($object->receivedDate) : 0;
    $epObject->receiver = isset($object->receiver) ? $object->receiver : '';
    $epObject->address = isset($object->address) ? $object->address : '';
    $epObject->code = isset($object->code) ? $object->code : '';
    $epObject->company = isset($object->company) ? $object->company : '';
    $epObject->weight = isset($object->weight) ? $object->weight : 0;
    $epObject->comment = isset($object->comment) ? $object->comment : '';
    $epObject->review = isset($object->review) ? $object->review : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->createdDate = ($epObject->createdDate != 0) ? SimpleDate::fromStamp($epObject->createdDate) : 0;
    $object->sentDate = ($epObject->sentDate != 0) ? SimpleDate::fromStamp($epObject->sentDate) : 0;
    $object->receivedDate = ($epObject->receivedDate != 0) ? SimpleDate::fromStamp($epObject->receivedDate) : 0;
    $object->receiver = $epObject->receiver;
    $object->address = $epObject->address;
    $object->code = $epObject->code;
    $object->company = $epObject->company;
    $object->weight = $epObject->weight;
    $object->comment = $epObject->comment;
    $object->review = $epObject->review;
    return $object;
  }
}
?>
